﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="AddNew.ascx.cs" Inherits="admin_Modules_detailPro_AddNew" %>

<%@ Register assembly="FreeTextBox" namespace="FreeTextBoxControls" tagprefix="FTB" %>
<script type="text/javascript">
    var txtMy = "ctl00_contentCtrl_ctl00_txt";
    var Err = "Err";
    var ArrField = new Array("name", "orderId");

    function ClearAll() {
        var l = ArrField.length;
        for (var i = 0; i < l; i++) {
            var myVal = document.getElementById(txtMy + ArrField[i]);
            myVal.value = "";

        }

        HideAll();
        var myCtrl = document.getElementById(txtMy + ArrField[0]);
        myCtrl.focus();
        return false;
    }

    function HideAll() {
        var l = ArrField.length;
        for (var i = 0; i < l; i++) {
            var myVal = document.getElementById(Err + ArrField[i]);
            if (myVal != null) {
                myVal.style.display = 'none';
            }
        }
        return false;
    }

    function OnSubmitClick() {
        HideAll();
        var errExisting = false;
        var l = ArrField.length;
        var Errfocus = false;
        for (var i = 0; i < l; i++) {
            var myVal = document.getElementById(txtMy + ArrField[i]);
            if (myVal.value == "") {
                var obj = document.getElementById(Err + ArrField[i]);
                obj.style.display = 'block';
                errExisting = true;
            }
            if (errExisting && !Errfocus) {
                myVal.focus();
                Errfocus = true;
            }
        }
        var objDes = document.getElementById(txtMy + 'Noidung__OuterTable');
        if (objDes != null) {
            if (objDes.value.length < 10) {
                var objErr = document.getElementById('ErrNoidung');
                objErr.style.display = 'block';
                errExisting = true;
            }
        }
        return !errExisting;
    }

    
</script>

<table cellpadding="0" cellspacing="0" border="0">
    <tr height="25">
        <td>
            <span style="font-family: Helvetica; font-size: 13px; color: Green; font-weight: bold">
                Thêm tin tức mới</span></td>
    </tr>
    
    <tr>
        <td>
            <div runat="server" id="MyUpdate">
                <table id='tbSearch' width="735" cellpadding="2" cellspacing="0" rules="rows"  border="1"
                    style="border-collapse: collapse">

                    
                    
                    <tr>
                        <td align="left" class="left">
                            Sản phẩm :</td>
                        <td class="center">
                            <asp:DropDownList ID="cbbidProduct" runat="server" DataTextField="Description" DataValueField="idProduct"  Width="300px">
                            </asp:DropDownList>
                            <span>(*)</span>
                        </td >
                         <td class="right" >
                         <div id="ErrTieude" class="Err" style=" display:none;">Vui lòng nhập vào tiêu đềập vào tiêu đề</div>
                       
                            </td>
                    </tr>

                      

                      <tr>
                        <td align="left" class="left">
                            Tiêu đề :</td>
                        <td class="center">
                           <asp:TextBox width="300px" id="txtname" runat="server" CssClass="lsbOpenDay"
                                emptymessage="" skin="Outlook" EnableViewState="true"></asp:TextBox><span>(*)</span>
                        </td >
                         <td class="right" >
                         <div class="Err" style=" display:none;" id="ErrDescription">Vui lòng nhập vào nội dung tóm tắt</div>
                            </td>
                    </tr>
                     <tr>
                        <td align="left" class="left">
                            Thứ tự :</td>
                        <td class="center">
                            <asp:TextBox width="300px" id="txtorderId" runat="server" 
                                textmode="SingleLine" CssClass="lsbOpenDay" onkeypress="return isNumberKey(event)"
                                emptymessage="" skin="Outlook" EnableViewState="true"></asp:TextBox><span>(*)</span>
                        </td >
                         <td class="right" >
                            <div id="ErrorderId" class="Err" style=" display:none;">Bạn chưa nhập số thứ tự</div>
                           
                         </td>
                    </tr>

             

              

                      <tr>
                        <td align="left" class="left">
                            Nội dung :</td>
                        <td class="center" colspan="2">
                            
                            
                            
                            <FTB:FreeTextBox ID="txtDescription" runat="server">
                            </FTB:FreeTextBox>
                            
                            <div id="ErrNoidung" class="Err" style=" display:none;">Bạn phải nhập trên 10 ký tự</div>
                            
                        </td >
                        
                    </tr>


                        
                  

                        <tr>
                            <td align="center" colspan="3">
                                <asp:Button runat="server" ID="btnAddNew" Text="Thêm mới" Font-Names="Helvetica"
                                    BorderStyle="Solid" BorderWidth="1" onclick="btnAddNew_Click"/>
                                <asp:Button runat="server" ID="btnCancel" Text="Nhập lại" Font-Names="Helvetica"
                                    BorderStyle="Solid" BorderWidth="1" />
                            </td>
                        </tr>

                    </table>
            
            </div>
        </td>
    </tr>


</table>

